package com.ruoyi.crm.controller;

import com.ruoyi.common.core.web.domain.AjaxResult;
import com.ruoyi.common.security.annotation.PreAuthorize;
import com.ruoyi.crm.service.QuotionProductService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/quotionproduct")
public class QuotionProductController {

    @Autowired
    private QuotionProductService quotionProductService;

    /**
     * 通过客户名称获取产品报价详细信息
     */
    @PreAuthorize(hasPermi = "crm:quotionproduct:query")
    @GetMapping(value = "/{customerName}")
    public AjaxResult getInfo(@PathVariable("customerName") String customerName)
    {
        AjaxResult success = AjaxResult.success(quotionProductService.selectQuotationProductById(customerName));
        return success;
    }
}
